package cc.vv.btpartyjob.partymanager.server

import cc.vv.baselibrary.util.UserInfoManageUtil
import cc.vv.btpartyjob.jnimodule.enums.RoleType
import cc.vv.btpartyjob.jnimodule.server.UserRoleServer
import cc.vv.btpartyjob.partymanager.moudel.bean.OperationBean

/**
 * 党务管理Server
 * Created by Chen.qi on 2018/10/24.
 */
object PartyManagerMainFragmentServer {


    fun getSheQuDangWei(): ArrayList<OperationBean> {
        val optionList = ArrayList<OperationBean>()
        val obj = OperationBean("", "社区组织")
        val obj1 = OperationBean("", "网格")
        val obj2 = OperationBean("", "楼栋党小组")
        val obj3 = OperationBean("", "单元中心户")
        val obj4 = OperationBean("", "社区活动")
        optionList.add(obj)
        optionList.add(obj1)
        optionList.add(obj2)
        optionList.add(obj3)
        optionList.add(obj4)

        if (UserRoleServer.getAreaRole() || UserRoleServer.getStreetRole()
                || UserRoleServer.getSheQuRole()
                || UserRoleServer.getSheQuDaDangWeiRole()) {
            val obj5 = OperationBean("", "组织查询")
            optionList.add(obj5)
        }
        return optionList
    }

    fun getSiShuangDataList(): ArrayList<OperationBean> {
        val optionList = ArrayList<OperationBean>()
        val userRole = UserInfoManageUtil.getUserInfo()?.userRole
        var isManager = false
        if (null != userRole && userRole.size > 0) {
            for (i in 0 until userRole.size) {
                if (RoleType.AREA_ADMIN.type == userRole[i].type
                        || RoleType.STREET_ADMIN.type == userRole[i].type
                        || RoleType.SECTION_ADMIN.type == userRole[i].type
                        || RoleType.GRID_ADMIN.type == userRole[i].type
                        || RoleType.UNIT_ADMIN.type == userRole[i].type) {
                    isManager = true
                    break
                }
            }
        }

        if (isManager) {
            val obj = OperationBean("", "单位报到")
            val obj1 = OperationBean("", "党员报到")
            val obj2 = OperationBean("", "报到统计")
            val obj3 = OperationBean("", "党员承诺")
            val obj4 = OperationBean("", "单位承诺")
            optionList.add(obj)
            optionList.add(obj1)
            optionList.add(obj2)
            optionList.add(obj3)
            optionList.add(obj4)
        } else {
            val obj1 = OperationBean("", "党员报到")
            optionList.add(obj1)
            val obj3 = OperationBean("", "党员承诺")
            optionList.add(obj3)
        }

        return optionList
    }

    fun getMeeting(): ArrayList<OperationBean> {
        val optionList = ArrayList<OperationBean>()
        val obj = OperationBean("", "简介")
        val obj1 = OperationBean("", "活动")

        optionList.add(obj)
        optionList.add(obj1)
        if (UserRoleServer.getAreaRole() || UserRoleServer.getStreetRole()
                || UserRoleServer.getSheQuRole()
                || UserRoleServer.getSheQuDaDangWeiRole()) {
            val obj2 = OperationBean("", " 组织查询 ")
            optionList.add(obj2)
        }
        return optionList
    }

    fun getProjectManager(): ArrayList<OperationBean> {
        val optionList = ArrayList<OperationBean>()
        val obj = OperationBean("", "项目查询")
        val obj1 = OperationBean("", "添加项目")
        val obj2 = OperationBean("", "项目预警")
        val obj3 = OperationBean("", "项目统计")
        optionList.add(obj)
        optionList.add(obj1)
        optionList.add(obj2)
        optionList.add(obj3)
        return optionList
    }

    fun getNoPublicParty(): ArrayList<OperationBean> {
        val optionList = ArrayList<OperationBean>()
        val obj = OperationBean("", "单位简介")
        val obj1 = OperationBean("", "评星晋级")
        val obj2 = OperationBean("", "政策文件")
        val obj3 = OperationBean("", "红领党建")
        optionList.add(obj)
        optionList.add(obj1)
        optionList.add(obj2)
        optionList.add(obj3)
        return optionList
    }

    fun getPovertyAlleviation(): ArrayList<OperationBean> {
        val optionList = ArrayList<OperationBean>()
        val obj = OperationBean("", "行政村管理")
        optionList.add(obj)
        val obj1 = OperationBean("", "四支队伍")
        optionList.add(obj1)
        return optionList
    }

    fun getDataSupport(): ArrayList<OperationBean> {
        val optionList = ArrayList<OperationBean>()
        val obj = OperationBean("", "组织数据")
        val obj1 = OperationBean("", "人员统计")
        val obj2 = OperationBean("", "在线统计")
        val obj3 = OperationBean("", "标准化数据")
        optionList.add(obj)
        optionList.add(obj1)
        optionList.add(obj2)
        optionList.add(obj3)
        return optionList
    }


    fun getLouDongTeam(): ArrayList<OperationBean> {
        val optionList = ArrayList<OperationBean>()
        val obj = OperationBean("", "一号楼")
        val obj1 = OperationBean("", "二号楼")
        val obj2 = OperationBean("", "三号楼")
        val obj3 = OperationBean("", "四号楼")
        val obj4 = OperationBean("", "五号楼")
        val obj5 = OperationBean("", "六号楼")
        val obj6 = OperationBean("", "七号楼")
        val obj7 = OperationBean("", "八号楼")
        optionList.add(obj)
        optionList.add(obj1)
        optionList.add(obj2)
        optionList.add(obj3)
        optionList.add(obj4)
        optionList.add(obj5)
        optionList.add(obj6)
        optionList.add(obj7)
        return optionList
    }

}